 <include file="application/home/view/public/header.html"/>
      <!-- /.aside -->
      <section id="content">
        <section class="vbox">
          <section class="scrollable padder">
             <header class="header bg-light bg-gradient b-b">
            <p>首页</p>
          </header>
          <section class="panel panel-default">
              <header class="panel-heading"> 奖金明细 </header>
              <div class="row text-sm wrapper">
                <div class="col-sm-5 m-b-xs">
                  <form action="{:U('Pay/activation')}" method="post"  role="form">
					<input type="text" name="account"  class="input-sm form-control input-s-sm inline" >
                    <input type="submit" class="btn btn-sm btn-default" value="搜索">
                  </form>
                </div>
                <div class="col-sm-4 m-b-xs">
                  	可用{$bb.name}：<span style="color:green;">{$bb.money}</span>
                </div>
              
              </div>
              <div class="table-responsive">
                <table class="table table-condensed table-hover">
								<thead>
								<tr>
									<th class='tt'>用户名</th>
									<th class='tt'>会员姓名</th>
									<th class='tt'>推荐人</th>
									<th class='tt'>状态</th>
									<th class='tt'>注册时间</th>
									<!--<th class='tt'>等级</th>-->
									<th class='tt'>操作</th>
								</tr>
								</thead>
								<tbody>
								<eq name="member.status" value="0">
                              <tr>
                                <td class='tt'>{$member.loginName}</td>
                                <td class='tt'>{$member.name}</td>
                                <td class='tt'>{$member.zhuce_name}</td>
                                <td class='tt'><eq name="member.status" value="0">未激活<else/>已激活</eq></td>
                                <td class='tt'>{$member.add_time| date='Y-m-d H:i:s',###}</td>
                                <td class='tt' id="money">
                                	<eq name="member.status" value="0">
                                	<select class="form-control" id="level{$member.member_id}" name="level" style="font-size:12px">
								  		<option value="" selected="selected">--请选择--</option>
								  		<foreach name="level" item="vl">
										  		<option value ="{$vl.id}">{$vl.name}</option>
										  	</foreach>	
									</select>
									<else/>
										{$member.level}
									</eq>

                                </td>
                               
                                <eq name="member.status" value="0">
								<td class='tt' value="123">
									<button onClick="sub('{$member.member_id}')" class="fa fa-long-arrow-up">激活</button>
									<button onClick="del('{$member.member_id}')" >删除</button>
									<!-- <a href="{:U('Baodan/jihuoDel',array('id'=>$v['member_id']))}"><input type="button" value="删除用户"></a> -->
								</td>
								<else/>
								<td>已激活</td>
								</eq>
                              </tr>
							<else/>
							
							</eq>
							
								
							<foreach name="list" item="vo">
                              <tr>
                                <td class='tt'>{$vo.loginName}</td>
                                <td class='tt'>{$vo.name}</td>
                                <td class='tt'>{$vo.zhuce_name}</td>
                                <td class='tt'><eq name="vo.status" value="0">未激活<else/>已激活</eq></td>
                                <td class='tt'>{$vo.createTime| date='Y-m-d H:i:s',###}</td>
                                <!--<td class='tt' id="money">
                                	<eq name="vo.status" value="0">
                                	<select class="form-control" id="level{$vo.member_id}" name="level" style="font-size:12px">
								  		<option value="" selected="selected">--请选择--</option>
								  		<foreach name="level" item="vl">
										  		<option value ="{$vl.id}">{$vl.name}</option>
										  	</foreach>	
									</select>
									<else/>
										{$vo.level}
									</eq>

                                </td>-->
                               
                                <eq name="vo.status" value="0">
								<td class='tt' value="123">
									<a class="dropdown-toggle btn btn-xs btn-primary" onClick="sub('{$vo.member_id}')">
										<i  class="fa fa-long-arrow-up">激活</i>
									</a>
									<a class="dropdown-toggle btn btn-xs btn-danger">
										<i onClick="del('{$vo.member_id}')" class="fa fa-trash-o">删除</i>
									</a>
									<!-- <a href="{:U('Baodan/jihuoDel',array('id'=>$v['member_id']))}"><input type="button" value="删除用户"></a> -->
								</td>
								<else/>
								<td>已激活</td>
								</eq>
                              </tr>
							</foreach>
                              <tr>
                                <td colspan="9">{$page}</td>
                              </tr>

							<foreach name="list_old" item="vl">
                              <tr>
                                <td class='tt'>{$vl.loginName}</td>
                                <td class='tt'>{$vl.name}</td>
                                <td class='tt'>{$vl.zhuce_name}</td>
                                <td class='tt'><eq name="vl.status" value="0">未激活<else/>已激活</eq></td>
                                <td class='tt'>{$vl.createTime| date='Y-m-d H:i:s',###}</td>
                               
                                <eq name="vl.status" value="0">
								<td class='tt' value="123">
									<a class="dropdown-toggle btn btn-xs btn-primary">
										<i onClick="sub('{$vl.member_id}')" class="fa fa-long-arrow-up">激活</i>
									</a>
									<a class="dropdown-toggle btn btn-xs btn-danger">
										<i onClick="del('{$vl.member_id}')" class="fa fa-trash-o">删除</i>
									</a>
									<!-- <a href="{:U('Baodan/jihuoDel',array('id'=>$v['member_id']))}"><input type="button" value="删除用户"></a> -->
								</td>
								<else/>
								<td>已激活</td>
								</eq>
                              </tr>
							</foreach>



								</tbody>
								</table>




              </div>
              <footer class="panel-footer">
                <div class="row">
                  <div class="col-sm-4 hidden-xs">
                  <!--  这里不可以删掉 -->
                  </div>
                  <div class="col-sm-4 text-center"> <small class="text-muted inline m-t-sm m-b-sm">showing {$list|count} of {$count} items</small> </div>
                  <div class="col-sm-4 text-right text-center-xs">
                    <ul class="pagination pagination-sm m-t-none m-b-none">
                      <li>{$page}</li>
                    </ul>
                  </div>
                </div>
              </footer>
            </section>
          </section>
        </section>
        <a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen" data-target="#nav"></a> </section>
      <aside class="bg-light lter b-l aside-md hide" id="notes">
        <div class="wrapper">Notification</div>
      </aside>
    </section>
  </section>
</section>
<script src="__PUBLIC__/home/js/app.v2.js"></script> <!-- Bootstrap --> <!-- App --> <script src="__PUBLIC__/home/js/charts/easypiechart/jquery.easy-pie-chart.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/sparkline/jquery.sparkline.min.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/flot/jquery.flot.min.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/flot/jquery.flot.tooltip.min.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/flot/jquery.flot.resize.js" cache="false"></script> <script src="js/charts/flot/jquery.flot.grow.js" cache="false"></script> <script src="__PUBLIC__/home/js/charts/flot/demo.js" cache="false"></script> <script src="__PUBLIC__/home/js/calendar/bootstrap_calendar.js" cache="false"></script> <script src="__PUBLIC__/home/js/calendar/demo.js" cache="false"></script> <script src="__PUBLIC__/home/js/sortable/jquery.sortable.js" cache="false"></script>
<script src="__PUBLIC__/js/layer/layer.js" type="text/javascript"></script>
</body>
</html>
<script>
//跳转激活详情页
//	function detial(id){
//		var level = $('#level'+id).val();//选择的等级id
//		if(level == ''){
//			layer.msg('请选择等级');
//			return;
//		}
//		//window.location.href="detial.html?member_id="+id+" & level="+level;
//		window.location.href="detial.html?member_id="+id;
//	}

	//激活
	function sub(id){
		var bool = true;
		var url = "{:U('Baodan/kaitong')}";
		if(bool){
			bool = false;
			$.post(url,{'member_id':id},function(data){
				if(data.status<0){
					layer.msg(data.info);	
					bool = true;	
				}else{
					layer.msg(data.info);
					setTimeout(function () { 
				      window.location.href="{:U('Pay/activation')}"
				   	}, 2000);
				}
			});
		}
	}


//删除
	function del(id){
		var url = "{:U('Pay/jihuoDel')}";
		layer.confirm('您确定要删除？', {
		  	btn: ['确定','取消'] //按钮
		}, function(){
		  	$.post(url,{'member_id':id},function(data){
				if(data.status == 1){
					layer.msg(data.info);

				}else{
					layer.msg(data.info);
				}
				setTimeout(function () { 
			      	 window.location.reload();
			    }, 2000);
			});
		}, function(){
		  	
		});
	}
</script>
